package com.vf.admin.client.controller.pay.nopay.dao;

import com.vf.admin.client.controller.pay.nopay.entity.AppNoPay;
import com.vf.admin.common.db.BaseDao;
import com.vf.admin.miaodong.entity.AppOrder;
import org.springframework.stereotype.Repository;
import java.util.ArrayList;
import java.util.List;
/**
 * 订单
 */
@Repository
public class AppNoPayDao extends BaseDao<AppOrder> {

    /**
     * 查询列表
     */
    public List<AppNoPay> list() {
        ArrayList<Object> paramList = new ArrayList<>();
        StringBuilder sbStr = new StringBuilder("select * from app_no_pay");
        String sql = sbStr.toString();
        return this.queryList(sql, paramList, AppNoPay.class);
    }

    public void update(Integer id, Integer count){
        String sql = " UPDATE app_no_pay SET count = ?  WHERE id = ? ";
        ArrayList<Object> paramList = new ArrayList<Object>();
        paramList.add(count);
        paramList.add(id);
        this.update(sql,paramList);
    }

    public AppNoPay getAlipay(){
        String sql = " select * from app_no_pay where type=1 ";
        ArrayList<Object> paramList = new ArrayList<>();
        return this.queryObj(sql, paramList, AppNoPay.class);
    }

    public AppNoPay getWxpay(){
        String sql = " select * from app_no_pay where type=2 ";
        ArrayList<Object> paramList = new ArrayList<>();
        return this.queryObj(sql, paramList, AppNoPay.class);
    }



}
